﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HostTool.Core
{
    /// <summary>
    /// 电源板
    /// </summary>
    class BoardTestBox:Board
    {

        public BoardTestBox(HostMachine machine)
            : base(machine)
        {
            CPU cpu = new TestBoxCPU(this, 0x10, "主CPU");
            AddCPU(cpu);
           
        }

        public override string Name
        {
            get
            {
                return "校时测试盒";
            }
        }

    }

    public class TestBoxCPU : CPU
    {
        string name = "";
        byte addr = 0;
        public TestBoxCPU(IBoard board, byte addr, string name)
            : base(board)
        {
            this.name = name;
            this.addr = addr;

            // 11H—测试盒APP
            //12H—记录板采集APP
            //13H—记录板控制APP
            //14H—控制板APP
            //15H—解码板APP
            //16H-连接板APP
            //17H-DSP bootloader
            //18H-DSP 参数

            AddFirmware(new FirmwareType("测试盒APP", 0x11));
       
            AddFirmware(new FirmwareType("控制板APP", 0x14));
            AddFirmware(new FirmwareType("解码板APP", 0x15));
            AddFirmware(new FirmwareType("DSP BIOS", 0x17));
            AddFirmware(new HostParamFirmType("DSP 参数", 0x18));

            AddFirmware(new FirmwareType("记录板采集APP", 0x12));
            AddFirmware(new FirmwareType("记录板控制APP", 0x13));

            AddFirmware(new FirmwareType("连接板APP", 0x16));
        }

        public override byte DstPort
        {
            get
            {
                return this.addr;
            }
        }
        public override string Name
        {
            get
            {
                return this.name;
            }
        }

        public override string Descriptor
        {
            get
            {
                return string.Format("{0}--{1}", this.Board.Name, this.name);
            }
        }

    }
}
